package cn.edu.cug.cs.gtl.plugins.device;

import cn.edu.cug.cs.gtl.apis.ui.AbstractApplication;
import cn.edu.cug.cs.gtl.apis.ui.actions.AbstractActions;
import cn.edu.cug.cs.gtl.apis.ui.actions.DeviceActions;
import cn.edu.cug.cs.gtl.plugins.device.actions.DeleteStorageClusterAction;
import cn.edu.cug.cs.gtl.plugins.device.actions.NewStorageClusterAction;
import cn.edu.cug.cs.gtl.plugins.device.actions.UpdateStorageClusterAction;
import org.pf4j.Extension;
import org.pf4j.Plugin;

import java.sql.SQLException;

public class DevicePlugin extends Plugin  {


    public DevicePlugin() {
        super();
    }


    @Override
    public void start() {
        super.start();
    }


    @Override
    public void stop() {
        super.stop();
    }


    @Override
    public void delete() {
        super.delete();
    }

    @Extension
    public static class DeviceActionsImpl extends AbstractActions implements DeviceActions {

        @Override
        public void initialize(AbstractApplication theApp) {
            //增加集群
            NewStorageClusterAction newStorageClusterAction = new NewStorageClusterAction();
            newStorageClusterAction.initialize(theApp);
            addAction(newStorageClusterAction);

            //修改集群
            UpdateStorageClusterAction updateStorageClusterAction = new UpdateStorageClusterAction();
            updateStorageClusterAction.initialize(theApp);
            addAction(updateStorageClusterAction);

            //删除集群
            DeleteStorageClusterAction deleteStorageClusterAction = new DeleteStorageClusterAction();
            deleteStorageClusterAction.initialize(theApp);
            addAction(deleteStorageClusterAction);
        }
    }
}
